package com.feri.fitness.cs.controller;

import com.feri.fitness.common.config.SystemConfig;
import com.feri.fitness.common.dto.MoodCommentAddDto;
import com.feri.fitness.cs.service.intf.MoodCommentService;
import com.feri.fitness.common.vo.R;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import org.springframework.web.bind.annotation.*;

/**
 * 千锋郑州Java学科欢迎你
 * @program: Fitness
 * @description: 控制层实现常用的外部接口
 * @author: Feri
 * @create: 2023-01-12 08:59:28
 */
@RestController
@RequestMapping("/server/moodComment/")
public class MoodCommentController{
    /**
    *注入业务逻辑层对象*/
    @Resource
    private MoodCommentService service;

    @PostMapping("add.do")
    public R add(@RequestBody MoodCommentAddDto dto, HttpServletRequest request){
        return service.add(dto,request.getIntHeader(SystemConfig.HEADER_UID));
    }
    @PostMapping("addrep.do")
    public R addRep(@RequestBody MoodCommentAddDto dto, HttpServletRequest request){
        return service.addReplay(dto,request.getIntHeader(SystemConfig.HEADER_UID));
    }
    @GetMapping("query.do")
    public R query(int mid){
        return service.query(mid);
    }
}